package com.zeldu.uaa.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zeldu.uaa.entity.Student;
import com.zeldu.uaa.entity.Teacher;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface TeacherMapper extends BaseMapper<Teacher> {
    @Select("select * from teacher where user_name=#{name}")
    Teacher findByName( String name);

    @Update("update teacher set pass_word=#{newPwd} where email_addr=#{email}")
    void findPwdBack(@Param("email") String email, @Param("newPwd") String newPwd);


    @Update("update teacher set pass_word=#{newPwd} where id=#{id}")
    void ChangPwd(@Param("id") Long id,@Param("newPwd") String newPwd);

    @Select("select pass_word from teacher where id=#{id}")
    String selectPwd(@Param("id") Long id);
}
